<template>
    <div class="catalogList">
        <img :src="data.img" alt="">
        <div class="list" v-for="item in data.data" :key="item.cat_id">
            <span class="title">-{{ item.cat_name }}-</span>
            <div class="goodsBox">
                <div class="goods" v-for="goods in item.child" :key="goods.cat_id">
                    <img :src="goods.touch_icon" alt="">
                    <span class="name">{{ goods.cat_name }}</span>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: ["data"]
}
</script>

<style scoped>
.catalogList {
    width: 77.3333vw;
    padding: 2.6667vw;
    padding-bottom: 26.6667vw;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;

    >img {
        width: 270px;
    }

    .list {
        display: flex;
        width: 100%;
        flex-direction: column;
        align-items: center;

        .title{
            font-size: 3.7333vw;
            line-height: 13.3333vw;
            color: black;
        }
        .goodsBox {
            width: 72vw;
            display: flex;
            flex-wrap: wrap;
            row-gap: 2.6667vw;
        }

        .goods {
            display: flex;
            flex-direction: column;
            width: 24vw;
            justify-content: space-between;
            height: 21.8667vw;
            align-items: center;
            font-size: 3.2vw;
            color: #999;

            img {
                width: 13.8667vw;
                height: 13.8667vw;
            }
            .name{
                line-height: 6.4vw;
            }
        }
    }
}
</style>